package net.lb.io.json;

import java.util.ArrayList;

public class JsonArray extends ArrayList<Object> implements Json
{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    public String toString()
    {
        return JsonUtil.toString(this);
    }
    
    public JsonObject getJsonObject(int index)
    {
        return (JsonObject) get(index);
    }
    
    public JsonArray getJsonArray(int index)
    {
        return (JsonArray) get(index);
    }
    
    public String getString(int index)
    {
        return (String) get(index);
    }
    
    public Long getLong(int index)
    {
        return ((Number) get(index)).longValue();
    }
    
    public Double getDouble(int index)
    {
        return ((Number) get(index)).doubleValue();
    }
    
    public float getFloat(int index)
    {
        return ((Number) get(index)).floatValue();
    }
    
    public Boolean getBoolean(int index)
    {
        return (Boolean) get(index);
    }
    
    public int getInt(int index)
    {
        return ((Number) get(index)).intValue();
    }
}
